Nowadays, more and more electronic devices support high-resolution displays, so that a small original image must be enlarged to ensure that the image can fit a high-resolution display of an electronic device.
The prior art provides an image enlargement method, in which a multiple of enlarging a low-resolution image is obtained first to obtain a zoom ratio, then an interpolation point that is in the original image and is corresponding to a to-be-interpolated pixel point in a high-resolution image is calculated according to the zoom ratio, and finally a pixel value of the to-be-interpolated pixel point corresponding to the interpolation point is calculated by using an interpolation method according to a pixel value of a pixel point in a neighbor area of the interpolation point.
As shown in FIG. 1, that interpolation is performed by using the Lanczos function is used as an example, where a horizontal distance from an interpolation point m to the nearest pixel point p6 in the upper left corner is a, and a perpendicular distance is b. A pixel value of the interpolation point m can be calculated according to the following:Value1=p1*LUT(1+b)+p5*LUT(b)+p9*LUT(1−b)+p13*LUT(2−b)Value2=p2*LUT(1+0+p6*LUT(b)+p10*LUT(1−b)+p14*LUT(2−b)Value3=p3*LUT(1+0+p7*LUT(b)+p11*LUT(1−b)+p15*LUT(2−b)Value4=p4*LUT(1+b)+p8*LUT(b)+p12*LUT(1−b)+p16*LUT(2−b)m=Value1*LUT(1+a)+Value2*LUT(a)+Value3*LUT(1−a)+Value4*LUT(2−a)
where p1 to p are 4×4 pixel points adjacent to the interpolation point m, for convenience, p1 to p16 in the formulas) also indicate pixel values of the pixel points, LUT( ) is the Lanczos function, a perpendicular distance from p1 to the interpolation point m is 1+b, and therefore a parameter of the Lanczos function in p1*LUT(1+b) is 1+b. Similarly, parameters of the Lanczos function can also be determined according to vertical distances from p2 to p16 pixel points to the interpolation point m. Value1 is an intermediate variable calculated according to the first column of pixel points, and similarly, Value2 to Value4 are intermediate variables calculated according to corresponding columns. A horizontal distance from the column corresponding to Value1 to the interpolation point m is 1+a. Therefore, a parameter of the Lanczos function in Value1*LUT(1+a) is 1+a, and similarly, parameters of the Lanczos function corresponding to Value2 to Value4 can also be determined. Therefore, it is necessary to know only a horizontal distance and a perpendicular distance from an interpolation point to the nearest pixel point in the upper left corner and pixel values of pixel points adjacent to the interpolation point, a pixel value of the interpolation point can be obtained through calculation.
However, in this method, if a multiple of enlarging an image is relatively large (generally exceeding three times), too much high-frequency information may get lost due to a function of a low-pass filter, and therefore a high-resolution image appears to be blurry.